#include "OthelloChessBoard.h"
#include "OthelloChess.h"
#include "../framework/ChessProtoManager.h"
#include <iostream>

OthelloChessBoard::OthelloChessBoard()
{
}
void OthelloChessBoard::setChess(QPoint p, std::string id){
    //std::cout<<p.x()<<" "<<p.y()<<std::endl;
    _chessBoard[p.x()][p.y()] = ChessProtoManager<OthelloChess>::getChess(id);
}
void OthelloChessBoard::initialBoard(){
    setChess(QPoint(3,3),"black");
    setChess(QPoint(3,4),"white");
    setChess(QPoint(4,3),"white");
    setChess(QPoint(4,4),"black");
    /*
    setChess(QPoint(0,4),"r_1");
    setChess(QPoint(0,3),"r_2");
    setChess(QPoint(0,5),"r_2");
    setChess(QPoint(0,2),"r_3");
    setChess(QPoint(0,6),"r_3");
    setChess(QPoint(0,1),"r_4");
    setChess(QPoint(0,7),"r_4");
    setChess(QPoint(0,0),"r_5");
    setChess(QPoint(0,8),"r_5");
    */
}

void OthelloChessBoard::resetChessBoard(){
    for(int i=0;i<_chessBoardLength;i++){
        for(int j=0;j<_chessBoardWidth;j++){
            _chessBoard[i][j] = NULL;
        }
    }
    initialBoard();
}

